/*kZime*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <cstdlib>
#include <algorithm>
#define MAXN 10023
using namespace std;
inline int read() {
	int k = 0, f = 1; char c = getchar();
	for(; !isdigit(c); c = getchar())if(c == '-') f = -1;
	for(; isdigit(c); c = getchar()) k = k * 10 + c - '0';
	return k * f;
}
/*-----------------------------------------------------------------------------*/

int a[MAXN], ans, cnt, n, head[MAXN], s[MAXN];

struct edge {
	int fr, to, ne;
	edge(){;}
	inline edge(int f, int t, int n) {
		fr = f;
		to = t;
		ne = n;
	}
}e[MAXN << 1];

void add_edge(int f, int t) {
	e[++cnt] = edge(f, t, head[f]), head[f] = cnt;
	e[++cnt] = edge(t, f, head[t]), head[t] = cnt;
}

void dp(int k, int fa) {
	if(s[k]) return;
	for(int i = head[k];i; i = e[i].ne) {
		int to = e[i].to;
		if(to == fa) continue;
		dp(to, k);
		s[k] += s[to];
	}
	s[k]++;
//	printf("%d\n", s[k]);
	if(n - s[k] <= n / 2) {
		for(int i = head[k];i; i = e[i].ne) {
			if(s[e[i].to] > n / 2) return;
		}
		a[ans++] = k;
	}
}

int main() {
#ifndef MYLAB
	freopen("treecut.in", "r", stdin);
	freopen("treecut.out", "w", stdout);
#else
//	freopen("in.txt", "r", stdin);
#endif

	n = read();
	for(int i = 1; i < n; i++) {
		add_edge(read(), read());
	}
	
	dp(1, 0);

	sort(a, a + ans);
	for(int i = 0; i < ans; i++) {
		printf("%d\n", a[i]);
	}

	return 0;
}

